<?php /* Smarty version 2.6.18, created on 2010-03-15 02:28:45
         compiled from dataOM_popup.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'cycle', 'dataOM_popup.tpl', 156, false),)), $this); ?>
<div id="main_content">
<div id="drag_bar" class="blue"><h2 class="dotted">Organism Details:</h2></div><br>
<div id="blanket" style="display:none;"></div>
<div width="100%">
	<table width="100%" class="boxed">
		<tr>
			<td bgcolor="#cccccc" colspan="2">
				<h3><b>Organism</b></h3>
			</td>
		</tr>
		<tr valign="top">
			<td>
				<form name="mainForm" method="POST" id="mainForm" action="/admin/dataOMAddOrg" enctype="multipart/form-data">
					<input type="hidden" name="organism_id" value="<?php echo $this->_tpl_vars['result'][0]['organism_id']; ?>
">
					<table border="0" width="100%">
						<tr>
							<td width="20%"><label>MOID:</label></td>
							<td>
								<input type="text" name="moid" value="<?php echo $this->_tpl_vars['result'][0]['moid']; ?>
">
							</td>
						</tr>
						<tr valign="top">
							<td><label>Picture:</label></td>
							<td><?php if ($this->_tpl_vars['result'][0]['link'] != null): ?><img src="<?php echo $this->_tpl_vars['result'][0]['link']; ?>
" width="200px" height="200px"><br><?php endif; ?>
								<input type="file" name="photo" value="<?php echo $this->_tpl_vars['result'][0]['link']; ?>
">
							</td>
						</tr>
						<tr>
							<td><label>MAC Certified:</label></td>
							<td>
								<input type="checkbox" name="mac_certified" value="1"
									<?php if ($this->_tpl_vars['result'][0]['mac_certified']): ?> checked <?php endif; ?>
								>
							</td>
						</tr>
						<tr>
							<td><label>Unsuitable Species:</label></td>
							<td>
								<input type="checkbox" name="u_species" value="1"
									<?php if ($this->_tpl_vars['result'][0]['unsuitable_species']): ?> checked <?php endif; ?>
								>
							</td>
						</tr>
						<tr>
							<td><label>Name:</label></td>
							<td>
								<input type="text" name="name" value="<?php echo $this->_tpl_vars['result'][0]['name']; ?>
">
							</td>
						</tr>
						<tr>
							<td><label>Scientific Name:</label></td>
							<td>
								<input type="text" name="sname" value="<?php echo $this->_tpl_vars['result'][0]['scientific_name']; ?>
">
							</td>
						</tr>
						<tr>
							<td><label>Sale Unit:</label></td>
							<td>
								<input type="text" name="sale_unit" value="<?php echo $this->_tpl_vars['result'][0]['sale_unit']; ?>
">
							</td>
						</tr>
						<tr>
							<td><label>Organism Group:</label></td>
							<td>
								<select name="organism_group">
									<?php $_from = $this->_tpl_vars['organism_groups']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['group']):
?>
										<option value="<?php echo $this->_tpl_vars['group']['organism_group_id']; ?>
"
										<?php if ($this->_tpl_vars['group']['organism_group_id'] == $this->_tpl_vars['result'][0]['organism_group_id']): ?>
											selected
										<?php endif; ?>
										>
										<?php echo $this->_tpl_vars['group']['organism_group']; ?>
</option>
									<?php endforeach; endif; unset($_from); ?>
								</select>
							</td>
						</tr>
						<tr>
							<td><label>Default Inventory Cost:</label></td>
							<td>
								<input type="text" name="DIC" value="<?php echo $this->_tpl_vars['result'][0]['default_inventory_cost']; ?>
">
							</td>
						</tr>
						<tr>
							<td><label>Default Base Price Sale:</label></td>
							<td>
								<input type="text" name="DBPS" value="<?php echo $this->_tpl_vars['result'][0]['default_base_price_sale']; ?>
">
							</td>
						</tr>
						<tr>
							<td><label>Currency Mark:</label></td>
							<td>
								<select name="currency_mark">
									<?php $_from = $this->_tpl_vars['currencies']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['currency']):
?>
										<option value="<?php echo $this->_tpl_vars['currency']['name']; ?>
"
										<?php if ($this->_tpl_vars['currency']['name'] == $this->_tpl_vars['result'][0]['currency_mark']): ?>
											selected
										<?php endif; ?>
										><?php echo $this->_tpl_vars['currency']['currency_mark']; ?>
</option>
									<?php endforeach; endif; unset($_from); ?>
								</select>
							</td>
						</tr>
						<tr>
							<td><label>Country Code:</label></td>
							<td>
								<select name="country_code">
									<?php $_from = $this->_tpl_vars['countries']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['country']):
?>
										<option value="<?php echo $this->_tpl_vars['country']['country_code']; ?>
"
										<?php if ($this->_tpl_vars['country']['country_code'] == $this->_tpl_vars['result'][0]['country_code']): ?>
											selected
										<?php endif; ?>
										>
										<?php echo $this->_tpl_vars['country']['country']; ?>
</option>
									<?php endforeach; endif; unset($_from); ?>
								</select>
							</td>
						</tr>
						<tr>
							<td><label>Province:</label></td>
							<td>
								<input type="text" name="province" value="<?php echo $this->_tpl_vars['result'][0]['province']; ?>
">
							</td>
						</tr>
						<tr valign="top">
							<td><label>Description:</label></td>
							<td>
								<textarea style="margin:5px 0 0 10px;" NAME="description" COLS=40 ROWS=6><?php echo $this->_tpl_vars['result'][0]['description']; ?>
</textarea>
								<br>
							</td>
						</tr>
					</table>
					<br><hr>
					<input type="submit" value="Save">
					<input type="button" value="Cancel" onclick="doajaxAction('/admin/dataOM',0,'main_content');">			
				</form>
			</td>
			<td>
			<form name="banFrom" method="POST" action="/admin/dataOMSaveBanListChanges">
				<div width="100%">
					<input type="hidden" name="organism_id" value="<?php echo $this->_tpl_vars['result'][0]['organism_id']; ?>
">
					<div width="100%" class="notify">
					<h3><b>Organism Seasonal Unsuitable Species</b></h3>
					</div>
					<div id="data_table">
					<table border="0" width="100%" class="boxed">
						<tr>
						</tr>
						<tr bgcolor="#cccccc">
							<td width="5%"></td>
							<td width="5%"><label><b>Delete<b></label></td>
							<td><label><b>Organization<b></label></td>
							<td><label><b>Date From<b></label></td>
							<td><label><b>Date To<b></label></td>
						</tr>
						<?php $_from = $this->_tpl_vars['banlist']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['ban']):
?>
						<tr class="<?php echo smarty_function_cycle(array('values' => "notify,blue"), $this);?>
">
							<td align="center"><input type="button" value="Edit" onclick="edit_item(<?php echo $this->_tpl_vars['ban']['id']; ?>
,<?php echo $this->_tpl_vars['result'][0]['organism_id']; ?>
)"></td>
							<td align="center"><input type="checkbox" value="1" name="del_<?php echo $this->_tpl_vars['ban']['id']; ?>
"></td>
							<td><?php echo $this->_tpl_vars['ban']['name']; ?>
</td>
							<td><?php echo $this->_tpl_vars['ban']['date_from']; ?>
</td>
							<td><?php echo $this->_tpl_vars['ban']['date_to']; ?>
</td>
						</tr>
						<?php endforeach; endif; unset($_from); ?>
					</table>
					</div><br><hr>
					<input type="button" value="Add" onclick="edit_item(0,<?php echo $this->_tpl_vars['result'][0]['organism_id']; ?>
)">
					<input type="submit" value="Delete">
				</div>
			</form>
			</td>
		</tr>
	</table>
</div>

<div id="popUpDiv" style="position:absolute;display:none;z-index:1002;">
	<table class="popup" border="0" cellspacing=0 cellpadding=0>
		<tr>
			<td>
				<div class="pop">
					<div class="top_pop"><img src="/app/default/www/images/top_left_pop.jpg" /></div> 
					<div id="edit_content" class="content">
					</div>
					<div class="btm_pop"><img src="/app/default/www/images/btm_left_pop.jpg"  alt="" /></div>
				</div>
			</td>
		</tr>
	</table> 
</div>
</div>

<?php echo '
<script language="javascript">
	ekimo_drag_region("","popUpDiv");
	
	function edit_item(id,organism_id){
		doajaxAction(\'/admin/dataOMEditBan/organism_id/\'+organism_id+\'/id/\'+id,0,\'edit_content\');
		popup(\'popUpDiv\');
	}
</script>
'; ?>
